package com.integrationpath.mengine.model;

// Generated 06-Jan-2010 12:35:49 by Hibernate Tools 3.2.5.Beta

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * LinkType generated by hbm2java
 */
@Entity
@Table(name = "link_type")
public class LinkType implements java.io.Serializable {

	private Integer id;
	private Role role;
	private String name;
	private Set<LinkCategory> linkCategories = new HashSet<LinkCategory>(0);

	public LinkType() {
	}

	public LinkType(Role role, String name, Set<LinkCategory> linkCategories) {
		this.role = role;
		this.name = name;
		this.linkCategories = linkCategories;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "role_id")
	public Role getRole() {
		return this.role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "linkType")
	public Set<LinkCategory> getLinkCategories() {
		return this.linkCategories;
	}

	public void setLinkCategories(Set<LinkCategory> linkCategories) {
		this.linkCategories = linkCategories;
	}

}
